﻿using PreGUI;
using PreGUI.Helpers;
using PreGUI.Widgets;
using UnityEngine;

public class TestUI : MonoBehaviour
{
    void Start()
    {
        var _gui = FindObjectOfType<PreGui>();
        _gui.BindViewModel("HelloWindow", new TestViewModel());
        
        // You can directly create a window from a resource (but for this example we use attribute binding)
        //_gui.CreateWindow(PGWindow.FromResource("HelloWindow"));

        // You can also bind directly...
        //gui.Bind("btnAccept.Clicked", x => Debug.Log("Clicked " + ((PGButton)x).Caption + "!"));
        //gui.Bind("btnCancel.Clicked", x => Debug.Log("Clicked " + ((PGButton)x).Caption + "!"));

        
    }

}
